<?php

/**
 * Description of inits
 * @author 耿鸿飞<eoe2005@qq.com>
 */
define('DS', DIRECTORY_SEPARATOR);
define('G_ROOT', realpath(dirname(__FILE__)).DS);
$_tmp_include_files = get_included_files();
/**
 * 项目应用的目录地址
 */
define('G_APPDIR',realpath(dirname(dirname($_tmp_include_files[0]))).DS);
//echo G_APPDIR;
/**
 * 自动加载架构文件
 * @param type $cls
 */
function G_autoload($cls){
    $dir = ucfirst(substr($cls, 2));
    $dir = G_ROOT.$dir.DS.$cls.'.cls.php';
    if(file_exists($dir)){
        include_once $dir;
    }
}
spl_autoload_register('G_autoload');
?>

